package main

import "fmt"

func test10_1() (sum int) {
	for i := 0; i <= 100; i++ {
		sum += i
	}
	return
}

func test10_2(n int) (sum int) {
	if n == 1 {
		return 1
	}
	return test10_2(n-1) + n
}

func main() {
	// 实现1+2+3+.....+ 100
	fmt.Println(test10_1())
	fmt.Println(test10_2(100))
}
